home *** CD-ROM | disk | FTP | other *** search
/ Everything You Wanted To…now: Microsoft Access 7.0 / Everything You Wanted to Know: Microsoft Access 7.0.iso / vfw11e / setup.mst < prev    next >
Encoding:
Text File  |  1995-08-04  |  10.9 KB  |  307 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40.  
  41. INIT:
  42.   
  43.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  44.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  45.     
  46.     WIN32ENABLED% = 0
  47.     MajorVer% = GetWindowsMajorVersion()
  48.     MinorVer% = GetWindowsMinorVersion()
  49.     Processor% = GetProcessorType()
  50.     WinDir$ = GetWindowsDir()
  51.     DEST$ = GetWindowsDir()
  52.     WinSysDir$ = GetWindowsSysDir()
  53.     WinSys32Dir$ = WinDir$ + "system32"
  54.  
  55.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  56.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  57.     END
  58.     END IF
  59.  
  60.     'Prevents installation on 286
  61.     IF Processor% < 3 THEN
  62.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  63.     END
  64.     END IF
  65.  
  66.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  67.     IF OnWindowsNT() THEN
  68.       OnNT$ = "TRUE"
  69.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  70.       IF WowVersion$ = "" THEN
  71.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  72.          END
  73.       END IF
  74.     END IF
  75.  
  76.     SetBitmap CUIDLL$, LOGO
  77.     SetTitle "Video for Windows 1.1 Runtime"
  78.  
  79.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  80.     IF szInf$ = "" THEN
  81.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  82.     END IF
  83.     ReadInfFile szInf$
  84.  
  85.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  86.  
  87. WELCOME:
  88. ''gpl
  89.        UIPop 1
  90. ''    sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  91. ''    IF sz$ = "CONTINUE" THEN
  92. ''       UIPop 1
  93. ''     ELSE
  94. ''    GOSUB ASKQUIT
  95. ''    GOTO WELCOME
  96. ''    END IF
  97.  
  98. ''Prepare Copy list and check size
  99.  
  100.     ClearCopyList
  101.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  102.  
  103. '' Remove DCISVGA file
  104.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  105.  
  106. ''  Runtime files (on Windows disk)
  107. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  108.  
  109.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  110.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  111.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  112.     END IF
  113.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  114.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  115.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  116.     IF OnNT$ = "TRUE" THEN
  117.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  118.     ENDIF
  119. ''*************************************************************************************************************************
  120. ''*************************************************************************************************************************
  121. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  122. ''and add a "DCI Provider" section with to the SETUP.INF file.
  123. ''
  124. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  125. ''*************************************************************************************************************************
  126. ''*************************************************************************************************************************
  127.  
  128. ''  Check windrive diskspace
  129.     SizeReq& = GetCopyListCost ("","", "")
  130.     IF SizeReq& <> 0 THEN
  131.     GOSUB SMALLWIN
  132.     END
  133.     END IF
  134.  
  135. Install
  136.  
  137. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  138. '' else, it gives the user the choice
  139.     RESTRT% = RestartListEmpty ()
  140.     Exe$ = DEST$ + "\_msrstrt.exe"
  141.     Batch$ = DEST$ + "\_mssetup.bat"
  142.     empty$ = ""
  143. RESTART:
  144.     IF RESTRT% = 0 THEN
  145.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  146.        IF sz$ = "REACTIVATE" THEN
  147.       GOTO RESTART
  148.        ENDIF
  149.        I% = ExitExecRestart ()
  150.        RemoveFile Exe$, cmoForce
  151.        RemoveFile Batch$, cmoForce
  152.        END
  153.     ELSE
  154. ''gpl
  155. i% = DoMsgBox("This installation is complete. For this installation to take effect, you MUST reboot your PC.", "Video for Windows 1.1 Runtime", MB_OK+MB_TASKMODAL)
  156. ''       sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  157. UIPopAll
  158. END
  159. sz$ = "EXIT"
  160.        IF sz$ = "CONTINUE" THEN
  161.       I% = ExitWindowsExec (Exe$, empty$)
  162.       IF I% = 0 THEN
  163.          GOTO RESTART
  164.       ELSE
  165.          END
  166.      ENDIF
  167.        ELSEIF sz$ = "EXIT" THEN
  168.       UIPopAll
  169.       END
  170.        ELSEIF sz$ = "REACTIVATE" THEN
  171.       GOTO RESTART
  172.        ELSE
  173.       UIPop 1
  174.        END IF
  175.     END IF
  176.  
  177.  
  178. QUIT:
  179.     ON ERROR GOTO ERRQUIT
  180.  
  181.     IF ERR = 0 THEN
  182.     dlg% = EXITSUCCESS
  183.     ELSEIF ERR = STFQUIT THEN
  184.     dlg% = EXITQUIT
  185.     ELSE
  186.     dlg% = EXITFAILURE
  187.     END IF
  188. QUITL1:
  189.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  190.     IF sz$ = "REACTIVATE" THEN
  191.     GOTO QUITL1
  192.     END IF
  193.     UIPop 1
  194.     END
  195.  
  196. ERRQUIT:
  197.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  198.     END
  199.  
  200.  
  201. ASKQUIT:
  202.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  203.  
  204.     IF sz$ = "EXIT" THEN
  205.     UIPopAll
  206. ''        ERROR STFQUIT
  207.     END
  208.     ELSEIF sz$ = "REACTIVATE" THEN
  209.     GOTO ASKQUIT
  210.     ELSE
  211.     UIPop 1
  212.     END IF
  213.     RETURN
  214.  
  215. SMALLWIN:
  216.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  217.     IF sz$ = "REACTIVATE" THEN
  218.     GOTO SMALLWIN
  219.     END IF
  220.     UIPop 1
  221.     RETURN
  222.  
  223. '**
  224. '** Purpose:
  225. '**     Performs all installation operations.
  226. '** Arguments:
  227. '**     none.
  228. '** Returns:
  229. '**     none.
  230. '*************************************************************************
  231. SUB Install STATIC
  232.  
  233.     SetRestartDir WinDir$
  234.     CopyFilesInCopyList
  235.  
  236. ''Updating WIN.INI and SYSTEM.INI
  237. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  238.  
  239. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  240.     IF VflatdPresent() = 0 THEN
  241.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  242.     END IF
  243. END IF
  244.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  246.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  247.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  248.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  249.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  250.     IF I% = 0  THEN
  251.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  252.     END IF
  253.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  254.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  255.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  256.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  257.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  259.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  260.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  261.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  262.  
  263. ''*************************************************************************************************************************
  264. ''*************************************************************************************************************************
  265. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  266. ''
  267. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  268. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  269. ''*************************************************************************************************************************
  270. ''*************************************************************************************************************************
  271.  
  272. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  273. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  274.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  275.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  276.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  277.  
  278. '' Mplayer
  279.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  280.  
  281. END IF    ''NT and next version of Windows installation stop here.
  282.  
  283.     Run ("profdisp.exe")   
  284. END SUB
  285.  
  286. '**
  287. '** Purpose:
  288. '**     Appends a file name to the end of a directory path,
  289. '**     inserting a backslash character as needed.
  290. '** Arguments:
  291. '**     szDir$  - full directory path (with optional ending "\")
  292. '**     szFile$ - filename to append to directory
  293. '** Returns:
  294. '**     Resulting fully qualified path name.
  295. '*************************************************************************
  296. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  297.     IF szDir$ = "" THEN
  298.     MakePath = szFile$
  299.     ELSEIF szFile$ = "" THEN
  300.     MakePath = szDir$
  301.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  302.     MakePath = szDir$ + szFile$
  303.     ELSE
  304.     MakePath = szDir$ + "\" + szFile$
  305.     END IF
  306. END FUNCTION
  307.